﻿@page
@model Emprise.Web.Areas.Admin.Pages.Config.EditModel
@{
    ViewData["Title"] = "配置管理";
    ViewData["MenuGroup"] = MenuGroupEnum.System;
}

@section CssJs{

    <link rel="stylesheet" type="text/css" href="~/admin/simditor/styles/simditor.css" />

    <script type="text/javascript" src="~/admin/simditor/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="~/admin/simditor/scripts/module.js"></script>
    <script type="text/javascript" src="~/admin/simditor/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="~/admin/simditor/scripts/simditor.js"></script>
    <script type="text/javascript" src="~/admin/simditor/scripts/beautify-html.js"></script>
    <script type="text/javascript" src="~/admin/simditor/scripts/simditor-html.js"></script>

    <link rel="stylesheet" href="~/admin/simditor/styles/simditor-html.css" media="screen" charset="utf-8" />
}
<div class="admin-content-body">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">配置管理</strong> / <small>修改配置</small></div>
    </div>

    <div class="am-margin">
        <form class="am-form" method="post">
            <div class="am-g">
                <p style="color:#666;font-size:10px;">注意：修改后1分钟内生效，<a href="@(Url.Page("Index"))">返回浏览模式</a></p>
                <div class="am-fade  am-in am-active">

                    @foreach (var config in Model.Configs)
                    {
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                @(config.Name)
                            </div>
                            <div class="am-u-sm-4">
                                @if (config.Type == typeof(bool))
                                {
                                    <select id="@(config.Key)" name="@(config.Key)">
                                        @if (config.Value == "True")
                                        {
                                            <option value="True" selected="selected">是</option>
                                            <option value="False">否</option>
                                        }
                                        else
                                        {
                                            <option value="True">是</option>
                                            <option value="False" selected="selected">否</option>
                                        }

                                    </select>
                                }
                                else
                                {


                                    <input type="text" tt="@(config.Type)" class="am-input-sm" name="@(config.Key)" value="@(config.Value)">
                                }

                            </div>
                            <div class="am-u-sm-6"></div>
                        </div>
                    }



                    <div class="am-margin-top-sm footer">
                        <div class="am-u-sm-2 am-text-right">

                        </div>
                        <div class="am-u-sm-10">
                            <button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
                            <a asp-page="./Index" class="am-btn am-btn-default am-btn-xs backup">返回</a>
                            <div class="am-inline-block am-padding-left">
                                <p style="color:#ff0000">@(Model.ErrorMessage)</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
</div>
@section Scripts {

    <script type="text/javascript">
        $(function () {


            $("input[type=checkbox]:checked").each(function () {
                $(this).parent(".am-btn").addClass("am-active");
            });
        });
    </script>
}
